/**
 * @Project POL3Cay
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Apr 1, 2011
 * @Createtime 5:21:25 PM
 */

package utils
{
	import com.smartfoxserver.v2.requests.buddylist.InitBuddyListRequest;

	import mx.formatters.NumberFormatter;

	public class TMHNumberFormat
	{
		private static var numberFormat:NumberFormatter = new NumberFormatter();

		public function TMHNumberFormat()
		{
			initData();
		}

		private static function initData():void
		{
			numberFormat.decimalSeparatorFrom = ",";
			numberFormat.decimalSeparatorTo = ",";
			numberFormat.useThousandsSeparator = true;
			numberFormat.useNegativeSign = true;
		}

		public static function numberToNumberFormated(number:String):String
		{
			initData();

			numberFormat.thousandsSeparatorFrom = "";
			numberFormat.thousandsSeparatorTo = ".";

			return numberFormat.format(number);
		}

		public static function numberFormatedToNumber(numberFormated:String):String
		{
			initData();

			numberFormat.thousandsSeparatorFrom = ".";
			numberFormat.thousandsSeparatorTo = "";

			return numberFormat.format(numberFormated);
		}
	}
}